package com.studentmanagement.dto;

import com.our.learning.infrastructure.po.Clazz;
import com.our.learning.infrastructure.po.Major;
import com.our.learning.infrastructure.po.Teacher;
import lombok.Data;
import lombok.ToString;

import java.util.ArrayList;

/**
 * @author hexujie
 * @date 2023-06-21 0:29
 */
@Data
@ToString
public class ClazzDTO {
    private Integer id;
    private String name;
    private Major major;
    private Integer studentNumber;
    private Teacher headTeacher;
    private ArrayList<StudentDTO> studentList;

    public Clazz getClazz() {
        Clazz clazz = new Clazz();
        clazz.setId(id);
        clazz.setName(name);
        clazz.setMajorId(major.getId());
        clazz.setStuNum(studentNumber);
        clazz.setTeacherId(headTeacher.getId());
        return clazz;
    }
}
